<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<div th:replace="fragment/front/meta"></div>
        <title th:utext="${application.siteName + ' - 发表文章'}"></title>
        <div th:replace="fragment/front/css"></div>
        <link rel="stylesheet" type="text/css" th:href="@{/statics/plugin/summernote/summernote.css}">
        <link rel="stylesheet" type="text/css" th:href="@{/statics/plugin/select2/select2.min.css}" />
        <style>
            .regular-text {
                padding: 5px 0px;
                text-indent: 10px;
                width:100%;
                height: 38px;
                font-size: 16px;
                text-align: left;
                border-radius: 5px;
                border: 1px solid #e5e5e5;
                box-shadow: 0 1px 1px rgba(0,0,0,0.05) inset;
            }
        </style>
	</head>
	<body>
		<div th:replace="fragment/front/nav"></div>
		
		<div class="container-wrap">
		    <div class="container">
		    	<form id="articleForm" method="post" action="">
		    	    <input name="id" th:value="${article?.id}" type="hidden"/>
			        <div class="row marginT20">
			            <input th:value="${article?.articleTitle}" type="text" id="articleTitle" name="articleTitle" class="regular-text" placeholder="请输入文章标题" >
			        </div>
			        <div class="row marginT20">
						&nbsp;&nbsp;文章分类：
						<select id="articleCategory" name="articleCategory" th:val="${article?.articleCategory}">
							<option value="">请选择文章分类</option>
							<optgroup th:each="dict : ${articleCategory}" th:if="*{dict.childList != null}" th:label="*{dict.dictText}">
							    <option th:each="child:*{dict.childList}" th:value="*{child.dictValue}" th:text="*{child.dictText}"></option>
							</optgroup>
						    <option th:each="dict : ${articleCategory}" th:if="*{dict.childList == null}" th:value="*{dict.dictValue}" th:text="*{dict.dictText}"></option>
						</select>
						&nbsp;&nbsp;文章标签：
                        <select id="articleLabel" name="articleLabel" th:val="${article?.articleLabel}" th:txt="${article?.articleLabel}">
                        </select>
						&nbsp;&nbsp;他人是否可见：
                        <select id="articleVisible" name="articleVisible" th:val="${article?.articleVisible}">
                            <option value="">请选择他人是否可见</option>
                            <option value="Y">是</option>
                            <option value="N">否</option>
                        </select>
					</div>
				    <div class="row marginT20">
					    <textarea name="articleContent" id="articleContent" th:utext="${article?.articleContent}"></textarea>
				    </div>
				    <div class="row marginB20 text-center">
				    	<button type="button" class="btn btn-primary btn-block" th:onclick="'cnCommonArticleAdd.submit(\'' + ${pType} + '\')'">提交</button>
				    </div>
		    	</form>
		    </div>
		</div>
		
		<div th:replace="fragment/front/footer"></div>
        <div th:replace="fragment/front/script"></div>
        <script type="text/javascript" th:src="@{/statics/plugin/summernote/summernote.js}"></script>
        <script type="text/javascript" th:src="@{/statics/plugin/summernote/lang/summernote-zh-CN.min.js}"></script>
        <script type="text/javascript" th:src="@{/statics/plugin/select2/select2.full.js}"></script>
        <script type="text/javascript" th:src="@{/statics/page/js/front/article/add.js}"></script>
    </body>
</html>